//
//  ZHCache.h
//  ZH_Helper
//
//  Created by caixiang on 2017/10/18.
//  Copyright © 2017年 蔡翔. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ZHCacheHelper : NSObject

/**
 异步缓存数据

 @param object 数据
 @param key 取值标示
 */
+ (void)zh_setObject:(id)object key:(NSString *)key;

/**
 异步缓存数据

 @param object 数据
 @param key 缓存标示
 @param block 取值成功的回调
 */
+ (void)zh_setObject:(id)object key:(NSString *)key withBlock:(void (^)(void))block;

/**
 同步取出缓存数据

 @param key 缓存标示
 @return 数据
 */
+ (id)zh_objectForKey:(NSString *)key;

/**
 异步取出缓存数据

 @param key 缓存标示
 @param block 异步取缓存成功的回调
 */
+ (void)zh_objectForKey:(NSString *)key withBlock:(void (^)(NSString *key, id<NSCoding> object))block;

/**
 同步移除缓存标示的缓存

 @param key 缓存标示
 */
+ (void)zh_removeObjectForKey:(NSString *)key;

/**
 异步移除缓存标示的缓存

 @param key 缓存标示
 @param block 异步移除成功的回调
 */
+ (void)zh_removeObjectForKey:(NSString *)key withBlock:(void (^)(NSString *key))block;

/**
 移除所有缓存
 */
+ (void)zh_removeAllObjects;

@end
